package com.example.demo99.Controller;

import com.example.demo99.Entity.OrderLog;
import com.example.demo99.Mapper.OrderLogMapper;
import com.example.demo99.Mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/order-log")
public class OrderLogController {
    @Autowired
    private OrderLogMapper orderLogMapper;
    @GetMapping("/list")
    public List<OrderLog> getLogs(@RequestParam Integer orderId) {
        System.out.println("Order log controller is working");

        return orderLogMapper.getLogsByOrderId(orderId);
    }
}
